<template>
  <div>
    <detail-banner :sightName="sightName" :bannerImg="bannerImg" :bannerImgs="gallaryImgs"></detail-banner>
    <detail-header></detail-header>
    <div class="content">
      <detail-list :list="list"></detail-list>
    </div>
  </div>
</template>

<script>
import DetailBanner from "./chirdran/Banner";
import DetailHeader from "./chirdran/Header";
import DetailList from "./chirdran/List";
import { getdetail } from "api/index";
export default {
  name: "Detail",
  components: {
    DetailBanner,
    DetailHeader,
    DetailList
  },
  data() {
    return {
      sightName: "",
      bannerImg: "",
      gallaryImgs: [],
      list: []
    };
  },
  mounted() {
    this.getdetaillist();
  },
  methods: {
    getdetaillist() {
      getdetail(this.$route.params.id).then(res => {
        const data = res.data;
        if (res.code == 0) {
          this.sightName = data.sightName;
          this.bannerImg = data.bannerImg;
          this.gallaryImgs = data.gallaryImgs;
          this.list = data.categoryList;
        }
      });
    }
  }
};
</script>

<style scoped>
.item {
  height: 100rem;
}
</style>